package cn.achao.csr.system.service.impl;


import cn.achao.csr.api.model.dto.RolePageDTO;
import cn.achao.csr.api.model.entity.SysRole;
import cn.achao.csr.datascope.annotation.DataScope;
import cn.achao.csr.system.dao.SysRoleDao;
import cn.achao.csr.system.service.SysRoleService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.stereotype.Service;

import lombok.extern.slf4j.Slf4j;
import lombok.RequiredArgsConstructor;

/**
 * (SysRole)表服务实现类
 *
 * @author achao
 * @since 2025-01-23 17:15:01
 */
@Slf4j
@Service("sysRoleService")
@RequiredArgsConstructor
public class SysRoleServiceImpl implements SysRoleService {

    private final SysRoleDao roleDao;

    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public Page<SysRole> selectRoleList(RolePageDTO req) {
        Page<SysRole> sysRolePage = roleDao.selectRoleList(req, req.plusPage());
        return sysRolePage;
    }
}
